package org.sky.cloud.common.http.handler;


import org.sky.cloud.common.http.HttpRestResult;
import org.sky.cloud.common.http.response.HttpClientResponse;

import java.lang.reflect.Type;


public interface ResponseHandler<T> {
    
    /**
     * set response type.
     *
     * @param responseType responseType
     */
    void setResponseType(Type responseType);
    
    /**
     * handle response convert to HttpRestResult.
     *
     * @param response http response
     * @return HttpRestResult {@link HttpRestResult}
     * @throws Exception ex
     */
    HttpRestResult<T> handle(HttpClientResponse response) throws Exception;
    
}
